package impl;

import java.util.ArrayList;
import java.util.List;





import interfaces.Position;
import worldofrobots.CandyEco;
import worldofrobots.RequiringPosition;
import worldofrobots.ReusableJoiningComp;
import worldofrobots.WorldEco;

public class World extends WorldEco{
	
	private List<Robots.Component> list =
			new ArrayList<Robots.Component>();

	@Override
	protected void start() {
		super.start();
		
		for (int i=0; i<3; i++) {
			System.out.println(i + " started");
			list.add(newRobots((i+"")));
		}
	}
	

	@Override
	protected CandyEco make_ce() {
		// TODO Auto-generated method stub
		return new Candy();
	}

	@Override
	protected ReusableJoiningComp make_rjc() {
		// TODO Auto-generated method stub
		return new ReusableJoiningComImpl();
	} 

	@Override
	protected Robots make_Robots(String id) {
		// TODO Auto-generated method stub
		return new Robots() {
			
			@Override
			protected String make_status() {
				System.out.println("In Status");
				return "ok";
			}

			@Override
			protected RequiringPosition make_rp() {
				// TODO Auto-generated method stub
				return new RequiringPosition() {
					
					
				};
			}
			
			
		};
	}


	@Override
	protected String make_hello() {
		
		System.out.println("List size: "+list.size());
		
		for (Robots.Component species : list ) {
			System.out.println("in make hello list of robots");
			species.status();
			
		}
		
		return "Nimic";
	}

}
